<template>
	<view>
		<view class="rad-list">
			<view class="rad-item" v-for="(r, i) in RadioList" :key="r.id" @click="naviTo(r.serial_id)">
				<view class="rad-image">
					<image :src="r.cover" mode="aspectFill"></image>
				</view>
				<view class="rad-info">
					<view class="info-title">
						{{r.title}}
					</view>
					<view class="info-author">
						{{r.subtitle}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		http
	} from '../untils/http.js'
	
	const url = 'find/serial/byyear/2020'
	const date = new Date()
	const year = date.getFullYear()
	
	export default {
		name:"LongView",
		data() {
			return {
				RadioList: []
			}
		},
		created() {
			http(url).then(res => {
				this.RadioList = res.data
				console.log(this.RadioList);
			})
		},
		methods: {
			naviTo(id) {
				uni.navigateTo({
					url: '/pages/LongDetails/LongDetails?id=' + id
				})
			}
		}
	}
</script>

<style lang="scss">
	* {
		box-sizing: border-box;
	}
	
	.rad-list {
		padding: 5px;
		width: 750rpx;
	}
	
	.rad-item {
		display: flex;
		padding: 10px;
		width: 100%;
		height: 120rpx;
		border-bottom: 1px solid #dedede;
		
		.rad-image {
			margin-right: 10px;
			flex: 1.2;
			
			image {
				width: 100%;
				height: 100%;
			}
		}
		
		.rad-info {
			flex: 8.8;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			
			.info-title {
				width: 590rpx;
				font-size: 14px;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
			
			.info-author {
				margin-bottom: 2px;
				font-size: 10px;
				color: #c1c1c1;
			}
		}
	}
</style>
